<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@include file="common.jsp"%>

<head>

<script type="text/javascript">

$(document).ready(function() {
var type;
function show_sub(v){ 
	type=v;
}  

	$("#searchOrders").click(function(){
		var typeValue=$("#user").val();
		window.location.href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?"+type+"="+typeValue;
	});
});

</script>

</head>

<!-- 内容区域 -->
<div class="tpl-content-wrapper">
	<div class="row-content am-cf">
		<div class="row">
			<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
				<div class="widget am-cf">
					<div class="widget-head am-cf">
						<div class="widget-title  am-cf">订单列表</div>


					</div>
					<div class="widget-body  am-fr">
					
						<div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
							<div class="am-form-group">
								<div class="am-btn-toolbar">
									<div class="am-btn-group am-btn-group-xs">
											 <a class="am-btn am-btn-default am-btn-secondary" href="${pageContext.request.contextPath}/backOrder/exportOrders.shtml">导出订单</a>
									</div>
								</div>
							</div>
						</div>
				
				
						<div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
							<div class="am-form-group tpl-table-list-select">
								<select id="selectParam" data-am-selected="{btnSize: 'sm'}"
									onchange="show_sub(this.options[this.options.selectedIndex].value)" >
									<option value="option1">所有类别</option>
									<option value="orderId">订单号</option>
									<option value="userAccount">商家ID</option>
									<option value="userAccount">用户账号</option>
									<option value="userAccount">商品名称</option>
								</select>
							</div>
						</div>
				
			
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
							<div
								class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
								<input type="text" id="user" class="am-form-field "> <span
									class="am-input-group-btn">
									
									<button id="searchOrders"
										class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"
										type="button">
									</button>
								</span>
							</div>
								
						</div>
	
						<div class="am-u-sm-12">
							<table width="100%"
								class="am-table am-table-compact am-table-striped tpl-table-black ">
								<thead>
									<tr>
										<th>订单号</th>
										<th>商家ID</th>
										<th>用户账号</th>
										<th>总金额</th>
										<th>订单状态</th>
										<th>下单时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr class="gradeX">
										<c:forEach items="${ordersVo}" var="item">
											<td>${item.orderId }</td>
											<td>${item.mid }</td>
											<td>${item.userAccount }</td>
											<td>${item.totalAmount }</td>
											<td><c:if test="${item.status==1 }">未付款</c:if> 
												<c:if test="${item.status==2}">待发货</c:if> 
												<c:if test="${item.status==3}">待收货</c:if> 
												<c:if test="${item.status==4 }">待评价</c:if></td>
											<td>${item.orderTime }</td>
											<td><a href="${pageContext.request.contextPath}/backOrder/getOrderInfo.shtml?orderId=${item.orderId }">查看详情</a>
											
											</td>
									</tr>
									</c:forEach>

									<!-- more data -->
								</tbody>
							</table>
						</div>
						<div class="am-u-lg-12 am-cf">

							<div class="am-fr">
								<ul class="am-pagination tpl-pagination">
									<!-- 上一页 -->
									<c:choose>
										<c:when test="${ pageHelper.currentPageIndex == 1}">
											<li class="am-disabled"><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${pageHelper.currentPageIndex-1}">«</a></li>
										</c:when>
										<c:otherwise>
											<li><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${pageHelper.currentPageIndex-1}">«</a></li>
										</c:otherwise>
									</c:choose>

									<!-- 页码 -->
									<c:forEach items="${pageHelper.pageNumList }" var="item">
										<c:if test="${ pageHelper.currentPageIndex == item}">
											<li class="am-active"><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${item}">${item }</a></li>
										</c:if>
										<c:if test="${ pageHelper.currentPageIndex != item}">
											<li><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${item}">${item }</a></li>
										</c:if>
									</c:forEach>

									<!-- 下一页 -->
									<c:choose>
										<c:when
											test="${ pageHelper.currentPageIndex == pageHelper.totalPages}">
											<li class="am-disabled"><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${pageHelper.currentPageIndex+1}">»</a></li>
										</c:when>
										<c:otherwise>
											<li><a
												href="${pageContext.request.contextPath}/backOrder/adminGetOrders.shtml?pageIndex=${pageHelper.currentPageIndex+1}">»</a></li>
										</c:otherwise>
									</c:choose>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script
	src="${pageContext.request.contextPath}/assets/js/amazeui.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/app.js"></script>

</body>

</html>